package com.s3.khospitalds.controller;

import com.s3.khospitalds.common.R;
import com.s3.khospitalds.entity.Turnover;
import com.s3.khospitalds.service.TurnoverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: xw
 * @CreateTime: 2025/2/20
 * @Description: 护士离职类
 * @Version: 1.0
 */
@RestController
@CrossOrigin(origins = "*")
public class TurnoverContrller {
    @Autowired
    private TurnoverService turnoverService;

    @GetMapping("/getAllTurnover")
    public R getAllTurnover() {//查询所有护士离职信息
        return new R().addData("Turnover",turnoverService.selectAll());
    }
    @GetMapping("/insertTurnover")
    public R insertTurnover(@RequestBody Turnover turnover) {//新增护士离职信息
        return new R().addData("bol",turnoverService.insert(turnover));
    }
    @GetMapping("/deleteTurnover")
    public R deleteTurnover(@RequestBody int id) {//删除护士离职信息
        return new R().addData("delete",turnoverService.removeById(id));
    }
}
